<?php
/*
 * Smarty plugin
 * -------------------------------------------------------------
 * File:     function.breadCrumbs.php
 * Type:     function
 * Name:     link
 * Purpose:  zwraca breadcrumbs w htmlu
 * -------------------------------------------------------------
 */


function smarty_function_breadCrumbs($params, &$smarty){

    $input = $smarty->get_template_vars('breadCrumbs');
    $return = array();
    if(is_array($input)) {
        foreach($smarty->get_template_vars('breadCrumbs') as $row) {
            if($row['url']!='') {
                $return[] = " <a href=\"".$row['url']."\" title=\"".htmlspecialchars(strip_tags($row['title']), ENT_QUOTES)."\">".$row['title']."</a> ";
            }else {
                $return[] = " ".$row['title']." ";
            }
        }

        return implode(BREAD_CRUMB_DELIMITER, $return);
    }
}
?>